package unverified

import (
	"net/http"

	"algo-sdk-go/project/matchmaking/matchMaking-api/internal/logic/unverified"
	"algo-sdk-go/project/matchmaking/matchMaking-api/internal/svc"
	"algo-sdk-go/project/matchmaking/matchMaking-api/internal/types"

	"github.com/zeromicro/go-zero/rest/httpx"
)

func QueryUnverifiedUserprofileHandler(svcCtx *svc.ServiceContext) http.HandlerFunc {
	return func(w http.ResponseWriter, r *http.Request) {
		var req types.QueryUserprofileRequest
		if err := httpx.Parse(r, &req); err != nil {
			httpx.Error(w, err)
			return
		}

		l := unverified.NewQueryUnverifiedUserprofileLogic(r.Context(), svcCtx)
		resp, err := l.QueryUnverifiedUserprofile(&req)
		if err != nil {
			httpx.Error(w, err)
		} else {
			httpx.OkJson(w, resp)
		}
	}
}
